home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
F1 Licenseware
/
F1 Licenseware - Volume 1.iso
/
disks
/
028.dms
/
028.adf
/
Features_of_the_Shell
/
Redirection
< prev
next >
Wrap
Text File
|
1992-02-26
|
2KB
|
41 lines
Redirection
Using the angle bracket (< and >) characters you can redefine the input and
output of commands to a different destination. As a default, input is from
the keyboard and output is via * (the current Shell or CLI window).
< is used to change input and > is used to change output. You will find
many CLI commands spew out lines and lines of text when run. For example,
SetPatch. To stop this happening you redirect output of that command to
a logical device called NIL:. NIL: is basically a `bin' where you throw all
the rubbish. Other devices can be used too. Here are a few examples...
Dir >PRT: Df0:
gives a directory list of the disk in df0: and sends
it to the logical (assigned) device PRT: which means the printer
selected in Preferences.
Dir >Testfile Df0:
is similar but outputs the list as a text file
called testfile.
>> is used for appending the output to a file. This means that
instead of putting the output in a file, it adds it to the end of a
file that already exists. Use it instead of >
Dir >>Testfile Df0:
adds the directory listing of the disk in df0: to
the file, Testfile.
Changing the input can be interesting, too
Date <Datefile ?
loads the date from a file on disk.
If you have an A1200 without an external clock, you can create a
file holding the current date so your files can be correctly
datestamped. This is very useful for Hard Drive users.
You can send a list of copied files to a destination, too
Copy >List SYS:C to C-Commands:
The file is copied as usual but a list is created called
List, which will be in the current directory.